# 1 "hello.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "hello.c"
# 1 "tree.h" 1
# 2 "hello.c" 2

typedef struct xh_core_map_info_tree {
    struct xh_core_map_info *rbh_root;
} xh_core_map_info_tree_t;

__attribute__((__unused__)) static void
xh_core_map_info_tree_RB_INSERT_COLOR(struct xh_core_map_info_tree *head,
                                      struct xh_core_map_info *elm) {
    struct xh_core_map_info *parent, *gparent, *tmp;
    while ((parent = (elm)->link.rbe_parent) != NULL && (parent)->link.rbe_color == 1) {
        gparent = (parent)->link.rbe_parent;
        if (parent == (gparent)->link.rbe_left) {
            tmp = (gparent)->link.rbe_right;
            if (tmp && (tmp)->link.rbe_color == 1) {
                (tmp)->link.rbe_color = 0;
                do {
                    (parent)->link.rbe_color = 0;
                    (gparent)->link.rbe_color = 1;
                }
                while (0);
                elm = gparent;
                continue;
            }
            if ((parent)->link.rbe_right == elm) {
                do {
                    (tmp) = (parent)->link.rbe_right;
                    if (((parent)->link.rbe_right = (tmp)->link.rbe_left) !=
                        NULL) { ((tmp)->link.rbe_left)->link.rbe_parent = (parent); }
                    do {} while (0);
                    if (((tmp)->link.rbe_parent = (parent)->link.rbe_parent) != NULL) {
                        if ((parent) == ((parent)->link.rbe_parent)->link.rbe_left)
                            ((parent)->link.rbe_parent)->link.rbe_left = (tmp);
                        else ((parent)->link.rbe_parent)->link.rbe_right = (tmp);
                    }
                    else (head)->rbh_root = (tmp);
                    (tmp)->link.rbe_left = (parent);
                    (parent)->link.rbe_parent = (tmp);
                    do {} while (0);
                    if (((tmp)->link.rbe_parent)) do {} while (0);
                }
                while (0);
                tmp = parent;
                parent = elm;
                elm = tmp;
            }
            do {
                (parent)->link.rbe_color = 0;
                (gparent)->link.rbe_color = 1;
            }
            while (0);
            do {
                (tmp) = (gparent)->link.rbe_left;
                if (((gparent)->link.rbe_left = (tmp)->link.rbe_right) !=
                    NULL) { ((tmp)->link.rbe_right)->link.rbe_parent = (gparent); }
                do {} while (0);
                if (((tmp)->link.rbe_parent = (gparent)->link.rbe_parent) != NULL) {
                    if ((gparent) == ((gparent)->link.rbe_parent)->link.rbe_left)
                        ((gparent)->link.rbe_parent)->link.rbe_left = (tmp);
                    else ((gparent)->link.rbe_parent)->link.rbe_right = (tmp);
                }
                else (head)->rbh_root = (tmp);
                (tmp)->link.rbe_right = (gparent);
                (gparent)->link.rbe_parent = (tmp);
                do {} while (0);
                if (((tmp)->link.rbe_parent)) do {} while (0);
            }
            while (0);
        }
        else {
            tmp = (gparent)->link.rbe_left;
            if (tmp && (tmp)->link.rbe_color == 1) {
                (tmp)->link.rbe_color = 0;
                do {
                    (parent)->link.rbe_color = 0;
                    (gparent)->link.rbe_color = 1;
                }
                while (0);
                elm = gparent;
                continue;
            }
            if ((parent)->link.rbe_left == elm) {
                do {
                    (tmp) = (parent)->link.rbe_left;
                    if (((parent)->link.rbe_left = (tmp)->link.rbe_right) !=
                        NULL) { ((tmp)->link.rbe_right)->link.rbe_parent = (parent); }
                    do {} while (0);
                    if (((tmp)->link.rbe_parent = (parent)->link.rbe_parent) != NULL) {
                        if ((parent) == ((parent)->link.rbe_parent)->link.rbe_left)
                            ((parent)->link.rbe_parent)->link.rbe_left = (tmp);
                        else ((parent)->link.rbe_parent)->link.rbe_right = (tmp);
                    }
                    else (head)->rbh_root = (tmp);
                    (tmp)->link.rbe_right = (parent);
                    (parent)->link.rbe_parent = (tmp);
                    do {} while (0);
                    if (((tmp)->link.rbe_parent)) do {} while (0);
                }
                while (0);
                tmp = parent;
                parent = elm;
                elm = tmp;
            }
            do {
                (parent)->link.rbe_color = 0;
                (gparent)->link.rbe_color = 1;
            }
            while (0);
            do {
                (tmp) = (gparent)->link.rbe_right;
                if (((gparent)->link.rbe_right = (tmp)->link.rbe_left) !=
                    NULL) { ((tmp)->link.rbe_left)->link.rbe_parent = (gparent); }
                do {} while (0);
                if (((tmp)->link.rbe_parent = (gparent)->link.rbe_parent) != NULL) {
                    if ((gparent) == ((gparent)->link.rbe_parent)->link.rbe_left)
                        ((gparent)->link.rbe_parent)->link.rbe_left = (tmp);
                    else ((gparent)->link.rbe_parent)->link.rbe_right = (tmp);
                }
                else (head)->rbh_root = (tmp);
                (tmp)->link.rbe_left = (gparent);
                (gparent)->link.rbe_parent = (tmp);
                do {} while (0);
                if (((tmp)->link.rbe_parent)) do {} while (0);
            }
            while (0);
        }
    }
    (head->rbh_root)->link.rbe_color = 0;
}

__attribute__((__unused__)) static void
xh_core_map_info_tree_RB_REMOVE_COLOR(struct xh_core_map_info_tree *head,
                                      struct xh_core_map_info *parent,
                                      struct xh_core_map_info *elm) {
    struct xh_core_map_info *tmp;
    while ((elm == NULL || (elm)->link.rbe_color == 0) && elm != (head)->rbh_root) {
        if ((parent)->link.rbe_left == elm) {
            tmp = (parent)->link.rbe_right;
            if ((tmp)->link.rbe_color == 1) {
                do {
                    (tmp)->link.rbe_color = 0;
                    (parent)->link.rbe_color = 1;
                }
                while (0);
                do {
                    (tmp) = (parent)->link.rbe_right;
                    if (((parent)->link.rbe_right = (tmp)->link.rbe_left) !=
                        NULL) { ((tmp)->link.rbe_left)->link.rbe_parent = (parent); }
                    do {} while (0);
                    if (((tmp)->link.rbe_parent = (parent)->link.rbe_parent) != NULL) {
                        if ((parent) == ((parent)->link.rbe_parent)->link.rbe_left)
                            ((parent)->link.rbe_parent)->link.rbe_left = (tmp);
                        else ((parent)->link.rbe_parent)->link.rbe_right = (tmp);
                    }
                    else (head)->rbh_root = (tmp);
                    (tmp)->link.rbe_left = (parent);
                    (parent)->link.rbe_parent = (tmp);
                    do {} while (0);
                    if (((tmp)->link.rbe_parent)) do {} while (0);
                }
                while (0);
                tmp = (parent)->link.rbe_right;
            }
            if (((tmp)->link.rbe_left == NULL || ((tmp)->link.rbe_left)->link.rbe_color == 0) &&
                ((tmp)->link.rbe_right == NULL || ((tmp)->link.rbe_right)->link.rbe_color == 0)) {
                (tmp)->link.rbe_color = 1;
                elm = parent;
                parent = (elm)->link.rbe_parent;
            }
            else {
                if ((tmp)->link.rbe_right == NULL || ((tmp)->link.rbe_right)->link.rbe_color == 0) {
                    struct xh_core_map_info *oleft;
                    if ((oleft = (tmp)->link.rbe_left) != NULL) (oleft)->link.rbe_color = 0;
                    (tmp)->link.rbe_color = 1;
                    do {
                        (oleft) = (tmp)->link.rbe_left;
                        if (((tmp)->link.rbe_left = (oleft)->link.rbe_right) !=
                            NULL) { ((oleft)->link.rbe_right)->link.rbe_parent = (tmp); }
                        do {} while (0);
                        if (((oleft)->link.rbe_parent = (tmp)->link.rbe_parent) != NULL) {
                            if ((tmp) == ((tmp)->link.rbe_parent)->link.rbe_left)
                                ((tmp)->link.rbe_parent)->link.rbe_left = (oleft);
                            else ((tmp)->link.rbe_parent)->link.rbe_right = (oleft);
                        }
                        else (head)->rbh_root = (oleft);
                        (oleft)->link.rbe_right = (tmp);
                        (tmp)->link.rbe_parent = (oleft);
                        do {} while (0);
                        if (((oleft)->link.rbe_parent)) do {} while (0);
                    }
                    while (0);
                    tmp = (parent)->link.rbe_right;
                }
                (tmp)->link.rbe_color = (parent)->link.rbe_color;
                (parent)->link.rbe_color = 0;
                if ((tmp)->link.rbe_right) ((tmp)->link.rbe_right)->link.rbe_color = 0;
                do {
                    (tmp) = (parent)->link.rbe_right;
                    if (((parent)->link.rbe_right = (tmp)->link.rbe_left) !=
                        NULL) { ((tmp)->link.rbe_left)->link.rbe_parent = (parent); }
                    do {} while (0);
                    if (((tmp)->link.rbe_parent = (parent)->link.rbe_parent) != NULL) {
                        if ((parent) == ((parent)->link.rbe_parent)->link.rbe_left)
                            ((parent)->link.rbe_parent)->link.rbe_left = (tmp);
                        else ((parent)->link.rbe_parent)->link.rbe_right = (tmp);
                    }
                    else (head)->rbh_root = (tmp);
                    (tmp)->link.rbe_left = (parent);
                    (parent)->link.rbe_parent = (tmp);
                    do {} while (0);
                    if (((tmp)->link.rbe_parent)) do {} while (0);
                }
                while (0);
                elm = (head)->rbh_root;
                break;
            }
        }
        else {
            tmp = (parent)->link.rbe_left;
            if ((tmp)->link.rbe_color == 1) {
                do {
                    (tmp)->link.rbe_color = 0;
                    (parent)->link.rbe_color = 1;
                }
                while (0);
                do {
                    (tmp) = (parent)->link.rbe_left;
                    if (((parent)->link.rbe_left = (tmp)->link.rbe_right) !=
                        NULL) { ((tmp)->link.rbe_right)->link.rbe_parent = (parent); }
                    do {} while (0);
                    if (((tmp)->link.rbe_parent = (parent)->link.rbe_parent) != NULL) {
                        if ((parent) == ((parent)->link.rbe_parent)->link.rbe_left)
                            ((parent)->link.rbe_parent)->link.rbe_left = (tmp);
                        else ((parent)->link.rbe_parent)->link.rbe_right = (tmp);
                    }
                    else (head)->rbh_root = (tmp);
                    (tmp)->link.rbe_right = (parent);
                    (parent)->link.rbe_parent = (tmp);
                    do {} while (0);
                    if (((tmp)->link.rbe_parent)) do {} while (0);
                }
                while (0);
                tmp = (parent)->link.rbe_left;
            }
            if (((tmp)->link.rbe_left == NULL || ((tmp)->link.rbe_left)->link.rbe_color == 0) &&
                ((tmp)->link.rbe_right == NULL || ((tmp)->link.rbe_right)->link.rbe_color == 0)) {
                (tmp)->link.rbe_color = 1;
                elm = parent;
                parent = (elm)->link.rbe_parent;
            }
            else {
                if ((tmp)->link.rbe_left == NULL || ((tmp)->link.rbe_left)->link.rbe_color == 0) {
                    struct xh_core_map_info *oright;
                    if ((oright = (tmp)->link.rbe_right) != NULL) (oright)->link.rbe_color = 0;
                    (tmp)->link.rbe_color = 1;
                    do {
                        (oright) = (tmp)->link.rbe_right;
                        if (((tmp)->link.rbe_right = (oright)->link.rbe_left) !=
                            NULL) { ((oright)->link.rbe_left)->link.rbe_parent = (tmp); }
                        do {} while (0);
                        if (((oright)->link.rbe_parent = (tmp)->link.rbe_parent) != NULL) {
                            if ((tmp) == ((tmp)->link.rbe_parent)->link.rbe_left)
                                ((tmp)->link.rbe_parent)->link.rbe_left = (oright);
                            else ((tmp)->link.rbe_parent)->link.rbe_right = (oright);
                        }
                        else (head)->rbh_root = (oright);
                        (oright)->link.rbe_left = (tmp);
                        (tmp)->link.rbe_parent = (oright);
                        do {} while (0);
                        if (((oright)->link.rbe_parent)) do {} while (0);
                    }
                    while (0);
                    tmp = (parent)->link.rbe_left;
                }
                (tmp)->link.rbe_color = (parent)->link.rbe_color;
                (parent)->link.rbe_color = 0;
                if ((tmp)->link.rbe_left) ((tmp)->link.rbe_left)->link.rbe_color = 0;
                do {
                    (tmp) = (parent)->link.rbe_left;
                    if (((parent)->link.rbe_left = (tmp)->link.rbe_right) !=
                        NULL) { ((tmp)->link.rbe_right)->link.rbe_parent = (parent); }
                    do {} while (0);
                    if (((tmp)->link.rbe_parent = (parent)->link.rbe_parent) != NULL) {
                        if ((parent) == ((parent)->link.rbe_parent)->link.rbe_left)
                            ((parent)->link.rbe_parent)->link.rbe_left = (tmp);
                        else ((parent)->link.rbe_parent)->link.rbe_right = (tmp);
                    }
                    else (head)->rbh_root = (tmp);
                    (tmp)->link.rbe_right = (parent);
                    (parent)->link.rbe_parent = (tmp);
                    do {} while (0);
                    if (((tmp)->link.rbe_parent)) do {} while (0);
                }
                while (0);
                elm = (head)->rbh_root;
                break;
            }
        }
    }
    if (elm) (elm)->link.rbe_color = 0;
}

__attribute__((__unused__)) static struct xh_core_map_info *
xh_core_map_info_tree_RB_REMOVE(struct xh_core_map_info_tree *head, struct xh_core_map_info *elm) {
    struct xh_core_map_info *child, *parent, *old = elm;
    int color;
    if ((elm)->link.rbe_left == NULL) child = (elm)->link.rbe_right;
    else if ((elm)->link.rbe_right == NULL) child = (elm)->link.rbe_left;
    else {
        struct xh_core_map_info *left;
        elm = (elm)->link.rbe_right;
        while ((left = (elm)->link.rbe_left) != NULL) elm = left;
        child = (elm)->link.rbe_right;
        parent = (elm)->link.rbe_parent;
        color = (elm)->link.rbe_color;
        if (child) (child)->link.rbe_parent = parent;
        if (parent) {
            if ((parent)->link.rbe_left == elm)
                (parent)->link.rbe_left = child;
            else (parent)->link.rbe_right = child;
            do {} while (0);
        }
        else (head)->rbh_root = child;
        if ((elm)->link.rbe_parent == old) parent = elm;
        (elm)->link = (old)->link;
        if ((old)->link.rbe_parent) {
            if (((old)->link.rbe_parent)->link.rbe_left == old)
                ((old)->link.rbe_parent)->link.rbe_left = elm;
            else ((old)->link.rbe_parent)->link.rbe_right = elm;
            do {} while (0);
        }
        else (head)->rbh_root = elm;
        ((old)->link.rbe_left)->link.rbe_parent = elm;
        if ((old)->link.rbe_right) ((old)->link.rbe_right)->link.rbe_parent = elm;
        if (parent) {
            left = parent;
            do { do {} while (0); } while ((left = (left)->link.rbe_parent) != NULL);
        }
        goto color;
    }
    parent = (elm)->link.rbe_parent;
    color = (elm)->link.rbe_color;
    if (child) (child)->link.rbe_parent = parent;
    if (parent) {
        if ((parent)->link.rbe_left == elm)
            (parent)->link.rbe_left = child;
        else (parent)->link.rbe_right = child;
        do {} while (0);
    }
    else (head)->rbh_root = child;
    color:
    if (color == 0) xh_core_map_info_tree_RB_REMOVE_COLOR(head, parent, child);
    return (old);
}

__attribute__((__unused__)) static struct xh_core_map_info *
xh_core_map_info_tree_RB_INSERT(struct xh_core_map_info_tree *head, struct xh_core_map_info *elm) {
    struct xh_core_map_info *tmp;
    struct xh_core_map_info *parent = NULL;
    int comp = 0;
    tmp = (head)->rbh_root;
    while (tmp) {
        parent = tmp;
        comp = (xh_core_map_info_cmp)(elm, parent);
        if (comp < 0) tmp = (tmp)->link.rbe_left;
        else if (comp > 0)
            tmp = (tmp)->link.rbe_right;
        else return (tmp);
    }
    do {
        (elm)->link.rbe_parent = parent;
        (elm)->link.rbe_left = (elm)->link.rbe_right = NULL;
        (elm)->link.rbe_color = 1;
    }
    while (0);
    if (parent != NULL) {
        if (comp < 0)
            (parent)->link.rbe_left = elm;
        else (parent)->link.rbe_right = elm;
        do {} while (0);
    }
    else (head)->rbh_root = elm;
    xh_core_map_info_tree_RB_INSERT_COLOR(head, elm);
    return (NULL);
}

__attribute__((__unused__)) static struct xh_core_map_info *
xh_core_map_info_tree_RB_FIND(struct xh_core_map_info_tree *head, struct xh_core_map_info *elm) {
    struct xh_core_map_info *tmp = (head)->rbh_root;
    int comp;
    while (tmp) {
        comp = xh_core_map_info_cmp(elm, tmp);
        if (comp < 0) tmp = (tmp)->link.rbe_left;
        else if (comp > 0)
            tmp = (tmp)->link.rbe_right;
        else return (tmp);
    }
    return (NULL);
}

__attribute__((__unused__)) static struct xh_core_map_info *
xh_core_map_info_tree_RB_NFIND(struct xh_core_map_info_tree *head, struct xh_core_map_info *elm) {
    struct xh_core_map_info *tmp = (head)->rbh_root;
    struct xh_core_map_info *res = NULL;
    int comp;
    while (tmp) {
        comp = xh_core_map_info_cmp(elm, tmp);
        if (comp < 0) {
            res = tmp;
            tmp = (tmp)->link.rbe_left;
        }
        else if (comp > 0) tmp = (tmp)->link.rbe_right; else return (tmp);
    }
    return (res);
}

__attribute__((__unused__)) static struct xh_core_map_info *xh_core_map_info_tree_RB_NEXT(
        struct xh_core_map_info *elm) {
    if ((elm)->link.rbe_right) {
        elm = (elm)->link.rbe_right;
        while ((elm)->link.rbe_left) elm = (elm)->link.rbe_left;
    }
    else {
        if ((elm)->link.rbe_parent && (elm == ((elm)->link.rbe_parent)->link.rbe_left))
            elm = (elm)->link.rbe_parent;
        else {
            while ((elm)->link.rbe_parent && (elm == ((elm)->link.rbe_parent)->link.rbe_right))
                elm = (elm)->link.rbe_parent;
            elm = (elm)->link.rbe_parent;
        }
    }
    return (elm);
}

__attribute__((__unused__)) static struct xh_core_map_info *xh_core_map_info_tree_RB_PREV(
        struct xh_core_map_info *elm) {
    if ((elm)->link.rbe_left) {
        elm = (elm)->link.rbe_left;
        while ((elm)->link.rbe_right) elm = (elm)->link.rbe_right;
    }
    else {
        if ((elm)->link.rbe_parent && (elm == ((elm)->link.rbe_parent)->link.rbe_right))
            elm = (elm)->link.rbe_parent;
        else {
            while ((elm)->link.rbe_parent && (elm == ((elm)->link.rbe_parent)->link.rbe_left))
                elm = (elm)->link.rbe_parent;
            elm = (elm)->link.rbe_parent;
        }
    }
    return (elm);
}

__attribute__((__unused__)) static struct xh_core_map_info *
xh_core_map_info_tree_RB_MINMAX(struct xh_core_map_info_tree *head, int val) {
    struct xh_core_map_info *tmp = (head)->rbh_root;
    struct xh_core_map_info *parent = NULL;
    while (tmp) {
        parent = tmp;
        if (val < 0) tmp = (tmp)->link.rbe_left; else tmp = (tmp)->link.rbe_right;
    }
    return (parent);
}

static xh_core_map_info_tree_t xh_core_map_info = {NULL};
